package com.hibernate.manytoone.entity;

import javax.persistence.*;

@Table(name = "phone")
@Entity
public class Phone {
    @Id
    private Long id;

    @Column(name = "number")
    private String number;

    @ManyToOne
    @JoinColumn(name = "person_id")
    private Person person;

    public Phone() {

    }

    public Phone(String s) {
        this.number = s;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}